import java.util.Arrays;

public class Tets {
    public static void main(String[] args) {
        String s1="name=zhangsan&age=10";
       String[] str=s1.split("&");
        for (String s: str) {
            System.out.println(s);
        }
        System.out.println("-----------------");
        String s2="hello world wang qi";
        String[] str2=s2.split(" ");
        for (String s: str2) {
            System.out.println(s);
        }
        System.out.println("---------------------");
        String[] str3=s2.split(" ",2);
        for (String s: str3) {
            System.out.println(s);
        }
        System.out.println("------------------");
        String[] str4=s2.split(" ",3);
        for (String s: str4) {
            System.out.println(s);
        }
        System.out.println("------------------");
        String[] str5=s2.split(" ",10);
        for (String s: str5) {
            System.out.println(s);
        }
    }
}
